#ifndef _LIB_RTSPSERVER_API_H
#define _LIB_RTSPSERVER_API_H
#include "stdbool.h"

#ifdef __cplusplus
extern "C"
{
#endif
#define Easy_Handle void
    typedef struct
    {
        uint8_t *addr; // Frame buff addr
        int len;       // frame len
        uint64_t pts;  // frame pts
    } easy_venc_pack;

    // One Frame 264 or 265
    typedef struct __EASY_VENC_STREAM_T
    {
        easy_venc_pack *pack;
        int pack_cnt;

    } EASY_VENC_STREAM_T;

    /*
        handle[out]             :Rtsp header,create by EasyServer_Init or EasyServer_AddStream;
        port[in]                :Rtsp net port eg:554,8554
        streamName[in]          :rtsp stream name,eg:rtsp://192.168.1.100:554/streamName
        descriptionString[in]   :no use
        is264[in]               :stream type,true:h264;false:h265
        username[in]            :rtsp auth info, null for no auth
        password[in]            :rtsp auth info, null for no auth
    */
    int EasyServer_Init(Easy_Handle **handle, int port,
                        const char *streamName,
                        const char *descriptionString,
                        bool is264, char const *username, char const *password);

    int EasyServer_AddStream(Easy_Handle **handle,
                             const char *streamName,
                             const char *descriptionString,
                             bool is264);
    /*
    handle[in]     :Rtsp header,create by EasyServer_Init or EasyServer_AddStream;
    */
    int EasyServer_Deinit(Easy_Handle *handle);

    /*
    handle[in]     :Rtsp header,create by EasyServer_Init or EasyServer_AddStream;
    stream[in]     :video stream data
    */
    int EasyRTSP_SetStream(Easy_Handle *handle,
                           EASY_VENC_STREAM_T *stream);

#ifdef __cplusplus
}
#endif
#endif //_LIB_RTSPSERVER_API_H
